<%--
  Created by IntelliJ IDEA.
  User: 小信
  Date: 2021/8/26
  Time: 16:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <title>我的信息</title>
</head>
<script type="text/javascript" src="/Netease_Cloud/js/jquery-3.4.1.min.js" ></script>
<body>
<h1>个人信息</h1>
<form method="post" action="my/update">
    <input type="text" name="uname" value="${user.uname}" disabled="disabled" class="i1">
    <input type="text" name="upass" value="${user.upass}" disabled="disabled" class="i2">
    <input type="hidden" name="id" value="${user.id}">
    <input type="submit" value="修改" disabled="disabled" class="i3"/>
</form>
<a class="a1" href="#">修改信息</a>--<a class="a2" href="#">取消</a>

<form method="POST" action="my/file" enctype="multipart/form-data">
    上传头像：<input type="file" name="data" >
    <input type="hidden" name="id" value="${user.id}">
    <input type="submit" value="提交"/>
</form>

<script>
    $(function (){
        //启动
        $(".a1").click(function (){
            $(".i1").removeAttr("disabled");
            $(".i2").removeAttr("disabled");
            $(".i3").removeAttr("disabled");
        })
        //禁用
        $(".a2").click(function (){
            $(".i1").attr("disabled",true);
            $(".i2").attr("disabled",true);
            $(".i3").attr("disabled",true);
        })
    })
</script>
</body>
</html>
